package com.ywk.json.core.impl;

import com.ywk.json.core.IOutPut;
import com.ywk.json.entity.User;
import com.ywk.json.entity.User1;
import org.springframework.beans.BeanUtils;

import java.util.ArrayList;
import java.util.List;

/**
 * @author zbh
 * @date 2022/3/9 14:07
 */
public class OutPutHandler1 implements IOutPut {

    @Override
    public List<User1> outPut(List contentList) {
        List<User1> user1List=new ArrayList<>();
        for (Object item : contentList) {
            User user=(User)item;
            User1 user1 = new User1();
            BeanUtils.copyProperties(user,user1);
            user1List.add(user1);
        }
        System.out.println("===============user1List=================");
        user1List.forEach(System.out::println);
        return user1List;

    }
}
